﻿using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;

namespace PuvBuilder
{
    public static class Extension
    {

        public static IServiceCollection AddPuvBuilder(this IServiceCollection services, Action<Options> action)
        {
            var options = new Options();
            action.Invoke(options);

            services.AddSingleton(options);
            services.AddSingleton<Builder>();
            return services;
        }


        public static Options ConfigSqlServer(this Options options, string connectionString)
        {
            options.DefaultSqlServerConnectionString = connectionString;
            return options;
        }
    }
}
